package com.java.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.java.dao.DiaryDao;
import com.java.entity.Diary;
import com.java.service.DiaryService;

@Service("diaryService")
public class DiaryServiceImpl implements DiaryService{

	@Resource
	private DiaryDao diaryDao;

	@Override
	public List<Diary> findAll(Map<String, Object> map) {
		
		return diaryDao.findAll(map);
	}

	@Override
	public long getTotal(Map<String, Object> map) {

		return diaryDao.getTotal(map);
	}

	@Override
	public Diary findById(Integer id) {
		
		return diaryDao.findById(id);
	}

	@Override
	public List<Diary> findtypeNameBydiaryId(Integer diaryTypeId) {
		
		return diaryDao.findtypeNameBydiaryId(diaryTypeId);
	}


	@Override
	public List<Diary> findByTypeId(Map<String, Object> map) {
		
		return diaryDao.findByTypeId(map);
	}

	@Override
	public long getTypeTotal(Map<String, Object> map) {
		
		return diaryDao.getTypeTotal(map);
	}

	@Override
	public void add(Diary diary) {
		diaryDao.add(diary);
	}

	@Override
	public void delete(Integer diaryId) {
		diaryDao.delete(diaryId);
	}

	@Override
	public void edit(Diary diary) {
		diaryDao.edit(diary);
	}

}
